package com.borko.healthcare.tapestry.components;

import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Zone;

import com.borko.healthcare.entities.interfaces.MedicineOrder;
import com.borko.healthcare.utils.interfaces.Cart;

public class Order {
	
	@Parameter(required = true)
	private Cart cart;
	
	@Parameter(required = true)
	private Zone cartZone;
	
	@Parameter(required = true)
	@Property
	private MedicineOrder medicineOrder;
	
	@Property
	private int qty;
	
	public Object onSuccessFromMedicineOrderForm() {
		cart.addMedicineOrder(medicineOrder, qty);
		
		return (Object)cartZone;
	}
}
